package com.webapp.org.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.webapp.org.bean.DepartmentBean;
import com.webapp.org.dao.DepartmentDAO;
import com.webapp.org.interfaces.IDepartment;

@Service("departmentservice")
public class DepartmentService implements IDepartment
{

	@Override
	public boolean insertDepartment(DepartmentBean DepartmentBean)
	{
      DepartmentDAO DepartmentDAO = new DepartmentDAO();
      boolean result = DepartmentDAO.insertDepartment(DepartmentBean);
	  return result;
	}

	@Override
	public boolean updateDepartment(DepartmentBean DepartmentBean)
	{
	      DepartmentDAO DepartmentDAO = new DepartmentDAO();
	      boolean result = DepartmentDAO.updateDepartment(DepartmentBean);
		  return result;
	}

	@Override
	public boolean deleteDepartment(int DepartmentId)
	{
	      DepartmentDAO DepartmentDAO = new DepartmentDAO();
	      boolean result = DepartmentDAO.deleteDepartment(DepartmentId);
		  return result;
	}

	@Override
	public List<DepartmentBean> retrieveDepartment()
	{
		DepartmentDAO DepartmentDAO = new DepartmentDAO();
		List<DepartmentBean> result = DepartmentDAO.retrieveDepartment();
		return result;

	}

	@Override
	public DepartmentBean getDepartment(int departmentId)
	{
		DepartmentDAO DepartmentDAO = new DepartmentDAO();
		DepartmentBean departmentBean = DepartmentDAO.getDepartment(departmentId);
		return departmentBean;
	}

}
